// pages/goods/readed_list/readed_list.js
var app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    scrollListHeight: '',
    readedList: [],//浏览记录列表
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getReadListOptions();
  },

  viewGoods: function (e) {
    var targetId = e.detail.id;
    wx.navigateTo({
      url: '../../goods_detail/goods_detail?goods_id=' + targetId + '&group_id=' + 0,
    })
  },

  getReadListOptions: function () {
    var readListOptions = {
      list_id: 'readList',
      url: '/api/index.php?app=account&act=visit_record',
    }
    var scrollListHeight = app.globalData.windowHeight - 2;
    this.setData({
      scrollListHeight: scrollListHeight,
      readListOptions: readListOptions
    })
  },

  loadMoreReadListData: function (e) {
    this.setData({
      readedList: e.detail.data
    })
  },
})